<template>
  <div>
    <ss v-for="(obj,index) in arr " :key="index" :obj1='obj'>


    </ss>
    <p>All Number:{{ sumNumber }}</p>
  </div>
</template>

<script>
  import ss from './components/mg'
  export default {
    components: {
      ss
    },
    data() {
      return {
        arr: [{
          count: 0,
          goodsName: "Watermelon"
        }, {
          count: 0,
          goodsName: "Banana"
        }, {
          count: 0,
          goodsName: "Orange"
        }, {
          count: 0,
          goodsName: "Pineapple"
        }, {
          count: 0,
          goodsName: "Strawberry"
        }]
      }
    },
    computed: {
      sumNumber() {
        return this.arr.reduce((sum, obj) => sum += obj.count * 1, 0)
      }
    }
  }
</script>

<style>

</style>